// list转el-tree
export function list2tree(data) {
    function loop(key) {
        const arr = [];
        data.forEach((item) => {
            if (item.parentId === key) {
                item.children = loop(item.id);
                arr.push(item);
            }
        });
        return arr;
    }
    return loop(0);
}
